package edu.gatech.cs2340.mule.model;
import java.io.Serializable;
import java.util.Random;


/**
 * 
 * This class will take care of calculating the bonus a player
 * receives at the pub
 * 
 * @author Keegan Nesbitt
 *
 */
public class PubInterface implements Serializable {
	
	private static final long serialVersionUID = 6673760916761764105L;
	
	private MuleGame game;
	private Pub gamePub;
	private TurnEngine turnEngine;
	
	/**
	 * 
	 * @param game The MuleGame object for the game
	 * @param gamePub The Pub object for the game
	 * @param turnEngine The TurnEngine object for the game
	 */
	public PubInterface(MuleGame game, Pub gamePub, TurnEngine turnEngine)	{
		this.game = game;
		this.gamePub = gamePub;
		this.turnEngine = turnEngine;
	}
	
	/**
	 * 
	 * @return The money bonus for a player gambling at the pub
	 */
	public int calculateMoneyBonus() {
		Random rand = game.getRandomNumGenerator();
		int currentRound = game.getRoundNumber();
		int timeLeft = turnEngine.getTimeLeft();
		
		return gamePub.calculateMoneyBonus(rand, currentRound, timeLeft);
	}
}
